package com.itboy.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @ClassName SysLog
 * @Description 操作日志
 * @Author 超 boy_0214@sina.com
 * @Date 2019/7/4 0004 11:49
 **/
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_sys_log")
@EntityListeners(AuditingEntityListener.class)
public class SysLog extends Pages implements Serializable {
    private static final long serialVersionUID = 7653752019434702089L;
    @Id
    @GenericGenerator(name="generator",strategy = "native")
    @GeneratedValue(generator = "generator")
    private Long id;
    @Column
    private String logName;
    @Column
    private String logType;
    @Column
    private String logDbSource;
    @Column(columnDefinition="TEXT")
    private String logContent;
    @Column(columnDefinition="TEXT")
    private String logResult;
    @Column
    private String logIp;
    @Column
    private String userid;
    @Column
    @CreatedDate
    @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss")
    private String logDate;
}
